package com.sec.android.app.myfiles.util.animation;

import android.animation.TimeInterpolator;

import com.altamirasoft.path_animation.PathAnimatorListener;
import com.sec.android.app.myfiles.R;
import com.sec.android.app.myfiles.util.animation.interpolator.SineInOut70;

/**
 * Created by yunju.cha on 2016-10-05.
 */
public class EmptyIconPathAnimatorListener implements PathAnimatorListener {
    private int mDuration[];
    private int mDelay[];
    private int mDirection[];
    private TimeInterpolator mInterpolator[];

    public EmptyIconPathAnimatorListener(int rawId) {
        init(rawId);
    }

    private void init(int rawId) {
        if (rawId == R.raw.myfile) {
            mDuration = new int[]{500, 200};
            mDelay = new int[]{0, 100};
            mDirection = new int[]{1, -1};
            mInterpolator = new TimeInterpolator[]{
                    new SineInOut70(), new SineInOut70()
            };
        } else {
            mDuration = new int[]{550, 200, 200, 200, 200};
            mDelay = new int[]{0, 50, 100, 150, 200};
            mDirection = new int[]{1, 1, -1, -1, 1};
            mInterpolator = new TimeInterpolator[]{
                    new SineInOut70(), new SineInOut70(), new SineInOut70(),
                    new SineInOut70(), new SineInOut70()
            };
        }
    }

    @Override
    public TimeInterpolator getInterpolator(int position) {
        return mInterpolator[position];
    }

    @Override
    public long getDuration(int position) {
        return mDuration[position];
    }

    @Override
    public long getDelay(int position) {
        return mDelay[position];
    }

    @Override
    public int getRepeatMode(int position) {
        return 0;
    }

    @Override
    public int getRepeatCount(int position) {
        return 0;
    }

    @Override
    public int getDirection(int position) {
        return mDirection[position];
    }

    @Override
    public int getStartPoint(int position) {
        return 0;
    }
}
